

namespace TrafficGrpc
{
    using System.Threading.Tasks;
    using Grpc.Core;
    using Microsoft.Extensions.Logging;
    using TrafficGrpc.Protos;
    public class TrafficChecker : TrafficGrpc.Protos.TrafficChecker.TrafficCheckerBase
    {
        private readonly ILogger<TrafficChecker> _logger;
        public TrafficChecker(ILogger<TrafficChecker> logger)
        {
            _logger = logger;
        }

        public override Task<TrafficConditionResponse> CheckTrafficCondition(TrafficConditionRequest request, ServerCallContext context)
        {
            return Task.FromResult(new TrafficConditionResponse
            {
                Message = request.Condition == "Clear"
            });
        }
    }
}
